import  java.util.Formatter; // 模板字符串
public class Student {

    public String getName() {
        return name;
    }

    public int getSid() {
        return sid;
    }
    
    public String getGender() {
        return gender;
    }

    public int getAge() {
        return age;
    }

    public String getPersionatity() {
        return personatity;
    }

    public int getClassID() {
        return ClassID;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setPersonatity(String personatity) {
        this.personatity = personatity;
    }

    public String name;
    public int sid;
    public int ClassID;
    public String gender;
    private int age;
    private String personatity; // 性格

    public void GetInfo() {
        String info = "这名学生的姓名为%s，他的学号是%d，班级是%d,性别是%s，年龄是%d岁，性格%s";
        Formatter formatter = new Formatter();
        formatter.format(info,name,sid,ClassID,gender,age,personatity);
        String result = formatter.toString();
        System.out.println(result);
    }

    public static void main(String[] args) {
        Student stu1 = new Student();
        stu1.name = "张三";
        stu1.sid = 1001;
        stu1.ClassID = 601;
        stu1.gender = "男";
        stu1.setAge(17);
        stu1.setPersonatity("活泼");
        stu1.GetInfo();

        Student stu2 = new Student();
        stu2.name = "李四";
        stu2.sid = 1002;
        stu2.ClassID = 602;
        stu2.gender = "男";
        stu2.setAge(18);
        stu2.setPersonatity("冷静");
        stu2.GetInfo();

        Student stu3 = new Student();
        stu3.name = "王五";
        stu3.sid = 1003;
        stu3.ClassID = 603;
        stu3.gender = "女";
        stu3.setAge(19);
        stu3.setPersonatity("内向");
        stu3.GetInfo();
    }
}
